package camid.distribution.events;

public class InvokerEvent {
	
	private Long timeSpent;
	
	private String objectId;
	
	private String entityClass;
	
	private String methodName;

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public String getEntityClass() {
		return entityClass;
	}

	public void setEntityClass(String entityClass) {
		this.entityClass = entityClass;
	}

	public String getMethodName() {
		return methodName;
	}

	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}

	public Long getTimeSpent() {
		return timeSpent;
	}
	
	private Long initialTime;
	
	public void startTimer()
	{
		this.initialTime = System.currentTimeMillis();
	}
	
	public void stopTimer()
	{
		if( initialTime != null && initialTime > 0)
		{
			Long endTime = System.currentTimeMillis();
			timeSpent = endTime - initialTime;
		}
		else
		{
			timeSpent = 0L;
		}
	}

}
